// lz 新建全局监听变量
import { defineStore } from 'pinia'
 
export const useNewConfig = defineStore('newConfig', {
  state: () => ({
    // isDark 监听暗模式开始和关闭
    idDark: window.localStorage.getItem("useDarkKey") && window.localStorage.getItem("useDarkKey") == 'dark' ? true : false,
    // 左侧导航条 展开和折叠监听
    leftNavOpen:  window.localStorage.getItem("sidebarStatus")  && window.localStorage.getItem("sidebarStatus") == '1' ? true : false
  }),
  actions: {
    setIsDark(val:boolean) {
      this.idDark = val;
    },
    setNavOpen(val:boolean) { 
      this.leftNavOpen = val
    }
  }
});